a, b, k = map(int,input().split())
ls = [a,b]
class Solution:
    def __init__(self):
        self.stack = set()
    def dfs(self,cur):
        if len(cur) == k:
            if sum(cur) == a or sum(cur) == b:
                s = list(map(str,cur))
                s = "".join(s)
                if s not in self.stack:
                    self.stack.add(s)
        else:
            c1 = cur[:]
            c2 = cur[:]
            c1.append(a)
            c2.append(b)
            self.dfs(c1)
            self.dfs(c2)

if __name__ == '__main__':
    s = Solution()
    s.dfs([])
    res = len(s.stack)
    # print(res)
    print(s.stack)